package dao.impl;

import java.sql.SQLException;

import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanHandler;

import dao.SelectProduct_CommentByusernameDao;
import entity.Product_Comment;
import util.C3P0Util;

public class SelectProduct_CommentByusernameDaoImpl implements SelectProduct_CommentByusernameDao {

	@Override
	public Product_Comment SelectProduct_CommentByusername(String username) {
		QueryRunner qr = new QueryRunner(C3P0Util.getDataSource());
		String sql = "select * from `user_inf` where username = ?";
		Product_Comment Product_Comment=null;		
		try {
			Product_Comment=qr.query(sql, username, new BeanHandler<Product_Comment>(Product_Comment.class));
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		return Product_Comment;
	}

}
